#pragma once

#include <iostream>
#include <string>
#include <functional>
#include "log.hpp"

using func_t = std::function<void(int, const std::string &, const uint16_t &, const std::string &)>;

class Task
{
public:
    Task() {}
    Task(int sock,const std::string & ip, uint16_t port,func_t func) 
        :sock_(sock)
        ,ip_(ip)
        ,func_(func)
    {}

    void operator()(const std::string& name)
    {
        func_(sock_,ip_,port_,name);
    }
    ~Task() {}

public:
    int sock_;
    std::string ip_;
    uint16_t port_;
    func_t func_;
};